<?php

/**
 * Generated Model class.
 */
class Base_GroupsPeer extends Db_Peer implements ISingleton
{

    const ID = '`groups`.`id`';

    const VK_ID = '`groups`.`vk_id`';

    const NAME = '`groups`.`name`';

    const URL = '`groups`.`url`';

    const PHOTO_BIG = '`groups`.`photo_big`';

    const PHOTO_MEDIUM = '`groups`.`photo_medium`';

    const PHOTO_SMALL = '`groups`.`photo_small`';

    const MEMBERS_COUNT = '`groups`.`members_count`';

    const ANTISPAM_WALL = '`groups`.`antispam_wall`';

    const CREATED_AT = '`groups`.`created_at`';

    const MODIFIED_AT = '`groups`.`modified_at`';

    protected $_name = 'groups';

    protected $_rowClass = 'GroupsRow';

    protected $_dependentTables = array(
        'TurnPeer',
        'User2groupPeer'
        );

    protected $_referenceMap = array();

    private static $_instance = null;

    protected $_metadata = array(
        'id' => array(
            'SCHEMA_NAME' => null,
            'TABLE_NAME' => 'groups',
            'COLUMN_NAME' => 'id',
            'COLUMN_POSITION' => 1,
            'DATA_TYPE' => 'int',
            'DEFAULT' => null,
            'NULLABLE' => false,
            'LENGTH' => null,
            'SCALE' => null,
            'PRECISION' => null,
            'UNSIGNED' => null,
            'PRIMARY' => true,
            'PRIMARY_POSITION' => 1,
            'IDENTITY' => true
            ),
        'vk_id' => array(
            'SCHEMA_NAME' => null,
            'TABLE_NAME' => 'groups',
            'COLUMN_NAME' => 'vk_id',
            'COLUMN_POSITION' => 2,
            'DATA_TYPE' => 'int',
            'DEFAULT' => null,
            'NULLABLE' => false,
            'LENGTH' => null,
            'SCALE' => null,
            'PRECISION' => null,
            'UNSIGNED' => true,
            'PRIMARY' => false,
            'PRIMARY_POSITION' => null,
            'IDENTITY' => false
            ),
        'name' => array(
            'SCHEMA_NAME' => null,
            'TABLE_NAME' => 'groups',
            'COLUMN_NAME' => 'name',
            'COLUMN_POSITION' => 3,
            'DATA_TYPE' => 'varchar',
            'DEFAULT' => null,
            'NULLABLE' => false,
            'LENGTH' => '256',
            'SCALE' => null,
            'PRECISION' => null,
            'UNSIGNED' => null,
            'PRIMARY' => false,
            'PRIMARY_POSITION' => null,
            'IDENTITY' => false
            ),
        'url' => array(
            'SCHEMA_NAME' => null,
            'TABLE_NAME' => 'groups',
            'COLUMN_NAME' => 'url',
            'COLUMN_POSITION' => 4,
            'DATA_TYPE' => 'varchar',
            'DEFAULT' => null,
            'NULLABLE' => false,
            'LENGTH' => '56',
            'SCALE' => null,
            'PRECISION' => null,
            'UNSIGNED' => null,
            'PRIMARY' => false,
            'PRIMARY_POSITION' => null,
            'IDENTITY' => false
            ),
        'photo_big' => array(
            'SCHEMA_NAME' => null,
            'TABLE_NAME' => 'groups',
            'COLUMN_NAME' => 'photo_big',
            'COLUMN_POSITION' => 5,
            'DATA_TYPE' => 'varchar',
            'DEFAULT' => null,
            'NULLABLE' => false,
            'LENGTH' => '256',
            'SCALE' => null,
            'PRECISION' => null,
            'UNSIGNED' => null,
            'PRIMARY' => false,
            'PRIMARY_POSITION' => null,
            'IDENTITY' => false
            ),
        'photo_medium' => array(
            'SCHEMA_NAME' => null,
            'TABLE_NAME' => 'groups',
            'COLUMN_NAME' => 'photo_medium',
            'COLUMN_POSITION' => 6,
            'DATA_TYPE' => 'varchar',
            'DEFAULT' => null,
            'NULLABLE' => false,
            'LENGTH' => '256',
            'SCALE' => null,
            'PRECISION' => null,
            'UNSIGNED' => null,
            'PRIMARY' => false,
            'PRIMARY_POSITION' => null,
            'IDENTITY' => false
            ),
        'photo_small' => array(
            'SCHEMA_NAME' => null,
            'TABLE_NAME' => 'groups',
            'COLUMN_NAME' => 'photo_small',
            'COLUMN_POSITION' => 7,
            'DATA_TYPE' => 'varchar',
            'DEFAULT' => null,
            'NULLABLE' => true,
            'LENGTH' => '256',
            'SCALE' => null,
            'PRECISION' => null,
            'UNSIGNED' => null,
            'PRIMARY' => false,
            'PRIMARY_POSITION' => null,
            'IDENTITY' => false
            ),
        'members_count' => array(
            'SCHEMA_NAME' => null,
            'TABLE_NAME' => 'groups',
            'COLUMN_NAME' => 'members_count',
            'COLUMN_POSITION' => 8,
            'DATA_TYPE' => 'int',
            'DEFAULT' => null,
            'NULLABLE' => false,
            'LENGTH' => null,
            'SCALE' => null,
            'PRECISION' => null,
            'UNSIGNED' => true,
            'PRIMARY' => false,
            'PRIMARY_POSITION' => null,
            'IDENTITY' => false
            ),
        'antispam_wall' => array(
            'SCHEMA_NAME' => null,
            'TABLE_NAME' => 'groups',
            'COLUMN_NAME' => 'antispam_wall',
            'COLUMN_POSITION' => 9,
            'DATA_TYPE' => 'tinyint',
            'DEFAULT' => '0',
            'NULLABLE' => false,
            'LENGTH' => null,
            'SCALE' => null,
            'PRECISION' => null,
            'UNSIGNED' => null,
            'PRIMARY' => false,
            'PRIMARY_POSITION' => null,
            'IDENTITY' => false
            ),
        'created_at' => array(
            'SCHEMA_NAME' => null,
            'TABLE_NAME' => 'groups',
            'COLUMN_NAME' => 'created_at',
            'COLUMN_POSITION' => 10,
            'DATA_TYPE' => 'datetime',
            'DEFAULT' => null,
            'NULLABLE' => false,
            'LENGTH' => null,
            'SCALE' => null,
            'PRECISION' => null,
            'UNSIGNED' => null,
            'PRIMARY' => false,
            'PRIMARY_POSITION' => null,
            'IDENTITY' => false
            ),
        'modified_at' => array(
            'SCHEMA_NAME' => null,
            'TABLE_NAME' => 'groups',
            'COLUMN_NAME' => 'modified_at',
            'COLUMN_POSITION' => 11,
            'DATA_TYPE' => 'timestamp',
            'DEFAULT' => '0000-00-00 00:00:00',
            'NULLABLE' => false,
            'LENGTH' => null,
            'SCALE' => null,
            'PRECISION' => null,
            'UNSIGNED' => null,
            'PRIMARY' => false,
            'PRIMARY_POSITION' => null,
            'IDENTITY' => false
            )
        );

    /**
     * @return GroupsPeer
     */
    public static function getInstance()
    {
        if (!self::$_instance) {
        	self::$_instance = new GroupsPeer();
        }
        return self::$_instance;
    }

    /**
     * @return Db_Rowset
     */
    public function findById($id)
    {
        $select = $this->select();
        $select->where('`id` = ?', $id);
        $rowset = $this->fetchAll($select);
        return $rowset;
    }

    /**
     * @return Db_Rowset
     */
    public function findByVkId($vk_id)
    {
        $select = $this->select();
        $select->where('`vk_id` = ?', $vk_id);
        $rowset = $this->fetchAll($select);
        return $rowset;
    }

    /**
     * @return Db_Rowset
     */
    public function findByName($name)
    {
        $select = $this->select();
        $select->where('`name` = ?', $name);
        $rowset = $this->fetchAll($select);
        return $rowset;
    }

    /**
     * @return Db_Rowset
     */
    public function findByUrl($url)
    {
        $select = $this->select();
        $select->where('`url` = ?', $url);
        $rowset = $this->fetchAll($select);
        return $rowset;
    }

    /**
     * @return Db_Rowset
     */
    public function findByPhotoBig($photo_big)
    {
        $select = $this->select();
        $select->where('`photo_big` = ?', $photo_big);
        $rowset = $this->fetchAll($select);
        return $rowset;
    }

    /**
     * @return Db_Rowset
     */
    public function findByPhotoMedium($photo_medium)
    {
        $select = $this->select();
        $select->where('`photo_medium` = ?', $photo_medium);
        $rowset = $this->fetchAll($select);
        return $rowset;
    }

    /**
     * @return Db_Rowset
     */
    public function findByPhotoSmall($photo_small)
    {
        $select = $this->select();
        $select->where('`photo_small` = ?', $photo_small);
        $rowset = $this->fetchAll($select);
        return $rowset;
    }

    /**
     * @return Db_Rowset
     */
    public function findByMembersCount($members_count)
    {
        $select = $this->select();
        $select->where('`members_count` = ?', $members_count);
        $rowset = $this->fetchAll($select);
        return $rowset;
    }

    /**
     * @return Db_Rowset
     */
    public function findByAntispamWall($antispam_wall)
    {
        $select = $this->select();
        $select->where('`antispam_wall` = ?', $antispam_wall);
        $rowset = $this->fetchAll($select);
        return $rowset;
    }

    /**
     * @return Db_Rowset
     */
    public function findByCreatedAt($created_at)
    {
        $select = $this->select();
        $select->where('`created_at` = ?', $created_at);
        $rowset = $this->fetchAll($select);
        return $rowset;
    }

    /**
     * @return Db_Rowset
     */
    public function findByModifiedAt($modified_at)
    {
        $select = $this->select();
        $select->where('`modified_at` = ?', $modified_at);
        $rowset = $this->fetchAll($select);
        return $rowset;
    }


}

